<template>
  <PresonItemCommonStyles v-if="data" :data="data">
    <template #rightTop>
      <slot name="rightTop"></slot>
    </template>
    <template #action>
      <slot name="action"></slot>
    </template>
    <template #timeTitle>
      <text class="time-name">{{ time.title }}</text>
    </template>
    <template #timeValue>
      <text class="time-value">{{ time.value }}</text>
    </template>
  </PresonItemCommonStyles>
  <view v-else class="empty-item">
    {{ configType === ShowModeEnum.Auto ? '自动轮播模式请以实际展示为准' : '暂无展示中信息' }}
  </view>
</template>
<script setup lang="ts">
  import type { IActivityRegister } from '@/api/activity/types';
  import PresonItemCommonStyles from '../../components/PresonItemCommonStyles.vue';
  import { computed, type PropType } from 'vue';
  import dayjs from 'dayjs';
  import { showModeDescriptions, ShowModeEnum } from '@/enums/activityStatusEnum';
  const props = defineProps({
    data: {
      type: Object as PropType<IActivityRegister>,
    },
    configType: {
      type: String as unknown as PropType<ShowModeEnum>,
    },
  });

  const time = computed(() => {
    return {
      title: '通过时间：',
      value: dayjs(props.data?.passTime).format('MM-DD HH:mm'),
    };
  });
</script>
<style lang="scss" scoped>
  .empty-item {
    width: 100%;
    height: 248rpx;
    border-radius: 16rpx;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #969799;
    font-size: 28rpx;
    line-height: 40rpx;
  }
</style>
